/**
 * 
 */
package com.miolr.module.core.social.security;

import java.util.Collection;

import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.social.connect.ConnectionData;

/**
 * @author iday
 * 
 */
public class OAuthAuthenticationToken extends AbstractAuthenticationToken {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8966476236229646425L;
	private final Object principal;
	private final ConnectionData connection;

	public OAuthAuthenticationToken(
			Collection<? extends GrantedAuthority> authorities,
			Object principal, ConnectionData connection) {
		super(authorities);
		this.principal = principal;
		this.connection = connection;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.springframework.security.core.Authentication#getCredentials()
	 */
	@Override
	public Object getCredentials() {
		return null;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.springframework.security.core.Authentication#getPrincipal()
	 */
	@Override
	public Object getPrincipal() {
		return principal;
	}

	public ConnectionData getConnection() {
		return connection;
	}

}
